/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.huongpq.btvn2;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Admin_Pro
 */
public class Bai3 {

    public static void main(String[] args) {
        File f = new File("bai 3.txt");
        try {
            f.createNewFile();

            FileReader fr = new FileReader(f);
            BufferedReader bf = new BufferedReader(fr);

            String a;
            long t;
            while ((a = bf.readLine()) != null) {
                try {
                    t = Long.parseLong(a);
                    StringBuffer s = new StringBuffer(a);
                    if (s.reverse().toString().equals(a)) {
                        System.out.println(a + " la so thuan nghich.");
                    } else {
                        System.out.println(a + " khong la so thuan nghich.");
                    }
                } catch (Exception e) {
                    System.out.println(a + " khong la mot so.");
                }
            }
        } catch (Exception ex) {
            Logger.getLogger(Bai3.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
}
